


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="htmlId">
<head>
  <title>Coverage Report :: Calculator</title>
  <style type="text/css">
    @import "../../.css/coverage.css";
  </style>
</head>

<body>
<div class="header"></div>

<div class="content">
<div class="breadCrumbs">
    [ <a href="../../index.html">all classes</a> ]
    [ <a href="../index.html">com.manning.junitbook</a> ]
</div>

<h1>Coverage Summary for Class: Calculator (com.manning.junitbook)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">Calculator</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (1/ 1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (4/ 4)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (8/ 8)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<div class="sourceCode"><i>1</i>&nbsp;/* 
<i>2</i>&nbsp; * ========================================================================
<i>3</i>&nbsp; * 
<i>4</i>&nbsp; * Licensed to the Apache Software Foundation (ASF) under one or more
<i>5</i>&nbsp; * contributor license agreements.  See the NOTICE file distributed with
<i>6</i>&nbsp; * this work for additional information regarding copyright ownership.
<i>7</i>&nbsp; * The ASF licenses this file to You under the Apache License, Version 2.0
<i>8</i>&nbsp; * (the &quot;License&quot;); you may not use this file except in compliance with
<i>9</i>&nbsp; * the License.  You may obtain a copy of the License at
<i>10</i>&nbsp; * 
<i>11</i>&nbsp; *   http://www.apache.org/licenses/LICENSE-2.0
<i>12</i>&nbsp; * 
<i>13</i>&nbsp; * Unless required by applicable law or agreed to in writing, software
<i>14</i>&nbsp; * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
<i>15</i>&nbsp; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<i>16</i>&nbsp; * See the License for the specific language governing permissions and
<i>17</i>&nbsp; * limitations under the License.
<i>18</i>&nbsp; * 
<i>19</i>&nbsp; * ========================================================================
<i>20</i>&nbsp; */
<i>21</i>&nbsp; 
<i>22</i>&nbsp;package com.manning.junitbook;
<i>23</i>&nbsp;
<b class="fc"><i>24</i>&nbsp;public class Calculator</b>
<i>25</i>&nbsp;{
<i>26</i>&nbsp;    public double add( double number1, double number2 )
<i>27</i>&nbsp;    {
<b class="fc"><i>28</i>&nbsp;        return number1 + number2;</b>
<i>29</i>&nbsp;    }
<i>30</i>&nbsp;
<i>31</i>&nbsp;    public double sqrt(double x) {
<b class="fc"><i>32</i>&nbsp;        if (x &lt; 0) {</b>
<b class="fc"><i>33</i>&nbsp;            throw new IllegalArgumentException(&quot;Cannot extract the square root of a negative value&quot;);</b>
<i>34</i>&nbsp;        }
<b class="fc"><i>35</i>&nbsp;        return Math.sqrt(x);</b>
<i>36</i>&nbsp;    }
<i>37</i>&nbsp;
<i>38</i>&nbsp;    public double divide(double x, double y) {
<b class="fc"><i>39</i>&nbsp;        if (y == 0) {</b>
<b class="fc"><i>40</i>&nbsp;            throw new ArithmeticException(&quot;Cannot divide by zero&quot;);</b>
<i>41</i>&nbsp;        }
<b class="fc"><i>42</i>&nbsp;        return x/y;</b>
<i>43</i>&nbsp;    }
<i>44</i>&nbsp;
<i>45</i>&nbsp;
<i>46</i>&nbsp;}
</div>
</div>

<div class="footer">
    
    <div style="float:right;">generated on 2019-06-19 13:23</div>
</div>
</body>
</html>
